import Vue from "vue";
import VueRouter from "vue-router";
import routes from './routes'
import {
    siteTitle
} from "@/utils"

if (!window.VueRouter) {
    Vue.use(VueRouter);
}



//路由配置
const router = new VueRouter({
    //路由规则
    routes,
    mode: 'history'
});

router.afterEach((to, from) => {
    // console.log(to.meta.title)
    // document.title = to.meta.title;
    siteTitle.setRouterTitle(to.meta.title)
})

export default router;